require('async-to-gen/register')
var FetchImgs = require('./fetch-imgs')
var rd = require('rd');
const util = require('util')
var moment = require('moment')
var UpYun = require('upyun');
var path = require('path')
var bucket = "pingo1"
var username = "pingo"
var passwd = "pin88888888"
var notify = "http://www.upyun.com/notify"
var secret = "LxEJGmFt51z6h6Z5lDw2Hz+IEG4="
var upyunRoot = "/m.chaopaikeji.com"
var serviceURI = "http://pingo1.b0.upaiyun.com"

//cli args
var argv = process.argv
var localRoot = argv[2]

FetchImgs.upyunUploadAndRecord(bucket, username, passwd, secret, upyunRoot, serviceURI, localRoot)
    .catch(error => util.log(error))